{
    title:  "MakeMe Overview",
    crumbs: []
}

        <h1>Embedthis MakeMe&trade; Overview</h1>
        <div class="floated">
            <img src="images/makeme-icon-128.png" class="ui left floated image" alt="makeme">
            <p>MakeMe is a modern replacement for the venerable 
            <a href="http://en.wikipedia.org/wiki/Make_(software)">make</a> and the not so popular 
            <a href="http://en.wikipedia.org/wiki/Autoconf">autoconf</a> tool.
            It manages the building of programs and products by direct compilation and the generation of IDE projects 
            and Makefiles. MakeMe can portably build programs for Linux, Mac and Windows and handles 
            cross-compilation with ease.</p>
        </div>

        <h2>MakeMe Command</h2>
        <p>MakeMe is run via the "<em>me</em>" command. So to build a project, just type:</p>
        <pre class="ui code segment"><b>me</b></pre>
        <p>Just like <em>make</em> you can build specific targets which MakeMe calls <em>goals</em>:</p>
        <pre class="ui code segment">
me clean
me compile
me myapp</pre>
        <h2>A Simple MakeMe File</h2>
        <p>A MakeMe file is written in Javascript, though with a .me extension. It contains a set of build
        instructions expressed as a Javascript object literal. For example:
        <pre class="ui code segment">
Me.load({
    targets: {
        /* Build the rocket executable */
        rocket: {
            type: 'exe',
            sources: '*.c',
        },
    }, 
})
</pre>
        <p>MakeMe files invoke <em>Me.load</em> to process build instructions. Arbitrary Javascript is permitted in 
        MakeMe files, but typically, little script code is needed.</p>
        <p>MakeMe files specify targets. These can be source files, libraries, executables or other actions to run.
        MakeMe has built-in rules to compile source code, build libraries, create executables, copy files, build packages and generate
        IDE projects. So, typically, you need to type very little to do the common tasks of building.</p>
        <p>MakeMe files can intelligently inherit global settings for a project and can override or augment values
        locally. MakeMe files run with a current directory set to that of the '<em>.me</em>' file itself, so it can 
        easily reference local resources. MakeMe projects are easy to relocate and avoid absolute directory
        references except for global tool chain programs and directories.</p>
        <p>MakeMe also provides a "configure" capability where it searches for required and optional tools for building. 
        MakeMe also supports cross-platform and cross-compilation building.</p>
        <a id="whyMakeMe"></a>
        <h2>Why MakeMe?</h2>
        <p>Many projects rely on <a href="http://en.wikipedia.org/wiki/Autoconf">autoconf</a> 
        to configure products and '<em>make</em>' to build. But autoconf is a baroque maze of
        scripts and make provides too little support for easily building executables and libraries in a cross platform
        manner. Further, neither of these tools work well for Windows and embedded platforms like VxWorks. 
        Consequently, creating portable Makefiles and autoconf scripts that will work on a variety of platforms
        and support cross compilation is an exercise in patience. Often the result is slow, fragile build
        systems, especially on Windows.</p>
        <p>MakeMe replaces both autoconf and make with a single utility. MakeMe provides a higher level of
        abstraction to easily specify the targets to build (libraries and executables) and can build directly on Linux,
        Mac OS X or Windows and cross compile for other platforms. It will generate native projects for Visual Studio,
        XCode, Make and Nmake projects. MakeMe builds fast without the complexity of autoconf and make.</p>

        <h3>History</h3>
        <p>MakeMe was initiated after evaluating Make, CMake and GYP for use by the 
        <a href="https://embedthis.com/appweb/">Appweb</a> and 
        <a href="https://embedthis.com/ejscript/">Ejscript</a> projects 
        in an embedded, cross compilation environment. While all three alternatives can be made to work, we 
        (<a href="https://embedthis.com/">Embedthis</a>)
        were expending too large a percentage of our time on the build system and less on the actual products. Out of this
        frustration, MakeMe was born. We do not expect MakeMe to be a universal replacement for Make or Autoconf 
        for everyone, but for some users with needs similar to our own, it may be an excellent choice.</p>
        
        <h3>MakeMe Design Goals</h3> 
        <p>When creating MakeMe, our design goals were:</p> <ul>
            <li>Create a build tool to be used by Embedthis for its own products</li>
            <li>Be portable across the major Unix platforms and Windows</li>
            <li>Easily manage cross-compilation and cross-compilers for embedded targets</li>
            <li>Generate native projects for IDE integration</li>
            <li>Build quickly, reliably and flexibly on windows without relying on Cygwin</li>
            <li>Support the entire build cycle: C dependencies, compilation, test and packaging</li>
            <li>Support the modular discovery, configuration and integration of tools and third-party plugins</li>
            <li>Be hackable and extendable and usable by all</li>
        </ul>
        <a id="differences"></a>
        <h2>MakeMe vs Make</h2>
        <p>Here is a quick list of differences between MakeMe and Make. These are broad, sweeping, and opinionated
            comments. Hopefully, with a grain of truth.</p>
        <ul>
            <li>Makefiles don't aggregate well. Make provides little support for combining makefiles. It offers bare
            facilities for inheriting and overriding project parameters in an orderly fashion.  Large projects often use
            recursive makefiles, but these have many well documented 
            <a href="http://aegis.sourceforge.net/auug97.pdf">issues</a>.  Trying to combine Makefiles from
            different products is typically not possible.
            MakeMe creates a single, unified view of how to build an entire product. The product may be comprised of many 
            MakeMe files, but these are combined in a well-defined manner. Lower-level MakeMe files can inherit properties 
           from upper levels and easily locally override settings as required.</li>
            <li>MakeMe is pre-programmed with default compiler and linker switches to achieve common tasks.
                With make, you have to add the switches yourself.</li>
            <li>MakeMe provides in-built understanding of how to build common targets like libraries and executables.
                With make, you have to specifically express the link command lines.</li>
            <li>Makefiles are often a mess. MakeMe files are terse and because MakeMe has a high-level understanding of
            how to build libraries and executables, you don't have to repeat common boiler-plate rules.</li>
            <li>Make and autoconf try to run on every possible Unix, but don't run on Windows (except for Cygwin which
            is too unreliable for production use). MakeMe supports the major Unix flavors: Linux, BSD and Mac OS X. 
            But it also supports Windows with ease.

            <li>Autoconf is incomprehensible. Just Google&trade; "hate autoconf". It is a mess of legacy shell scripts 
            that try to address building on all possible systems. but Autoconf fails at building simply and well on the 
            common platforms. MakeMe does not try to create the universal <em>config.h</em> header to mange obscure 
            C compilers. It instead focuses on the dominant platforms. MakeMe provides an open, plugin framework for searching for components. This makes it easy to configure a build based on the components available on the target computer.</li>
            <li>MakeMe is fast &mdash; typically much faster than autoconf and make. Because it uses Ejscript internally, 
            file copy and script commands can be executed without spawning a shell. This also means that you can have
            a uniform scripting environment on Windows.</li>
        </ul>
